﻿@model BookViewModel

	<div id="bookEditingContainer" class="hidden">
		@using (Html.BeginForm("AddBook", "Library", FormMethod.Post, new { id = "bookEditingForm", data_add = Url.Action("AddBook", "Library"), data_update = Url.Action("UpdateBook", "Library") }))
	{
			@Html.Hidden("ID",0, new { id = "hfBookID" })
			@Html.Hidden("currentPage", 1, new { id="hfCurrentPage" })
			<div class="bookContentContainer">
				<div class="commandBar bookCommandBar">
					<span id="uploadBookInfoIcon" class="icon inactiveAmazonIcon mediumIcon" data-tooltip-type="@((int)TooltipType.UploadFrom)" data-tooltip-url="@Url.Action("GetGenericTooltip","Tooltip")" data-tooltip-id="genericTooltip" data-postback="@Url.Action("GetPreloadBook")">&nbsp;</span>
					<span class="icon saveIcon mediumIcon" data-tooltip-type="@((int)TooltipType.Save)" data-tooltip-url="@Url.Action("GetGenericTooltip", "Tooltip")"  data-tooltip-id="genericTooltip">&nbsp;</span> 
					<span class="icon cancelIcon mediumIcon" data-tooltip-type="@((int)TooltipType.Cancel)" data-tooltip-url="@Url.Action("GetGenericTooltip", "Tooltip")"  data-tooltip-id="genericTooltip">&nbsp;</span>
				</div>
				<div class="bookContent">
					<div class="bookInfo">
						<div class="bookTitle">
						@Html.TextBox("BookTitle", "Book's title...", new { @class = "titleBox defaultHeaderFont title", id = "txtTitle", data_default="Book's title..." })
							<span class="defaultHeaderFont lighter">by</span>
							@Html.TextBox("Authors", "Book's author...", new { @class = "titleBox defaultHeaderFont lighter author", id = "txtAuthor", data_default="Book's author"})
						</div>
						<div class="bookDescriptionContainer">
							@Html.TextArea("Description", value: "Book's description...", columns: 38, rows: 10, htmlAttributes: new { id = "txtDescription", @class = "descriptionBox defaultMainFont", data_default="Book's description" })
						</div>
						<div class="bookFooter" >
							<!--
							<div class="tagsContainer">
								<span class="tagsTitle">Tags:</span>
								<span class="defaultMainFont">None</span>
								<span id="tagsPickIcon" class="icon smallIcon smallEditIcon" data-tooltip-type="@((int)TooltipType.ChooseTags)" data-tooltip-url="@Url.Action("GetGenericTooltip","Tooltip")" data-tooltip-id="genericTooltip">&nbsp;</span>
							</div>
							-->
							<div class="ownerContainer">
								<div class="owner">
									<span class="ownerTitle">Owner:</span>
									<span id="txtOwner" class="defaultMainFont" data-default="Library" data-tooltip-url="@Url.Action("GetPersonInfoTooltip", "Tooltip")" data-person-id="" data-tooltip-id="personInfoTooltip">Library</span>
									<span id="ownerPickIcon" class="icon smallIcon smallEditIcon" data-tooltip-type="@((int)TooltipType.PickPerson)" data-tooltip-url="@Url.Action("GetGenericTooltip","Tooltip")" data-tooltip-id="genericTooltip">&nbsp;</span>
									<span id="removePickIcon" class="icon smallIcon crossIcon" data-tooltip-type="@((int)TooltipType.RemovePickedPerson)" data-tooltip-url="@Url.Action("GetGenericTooltip","Tooltip")" data-tooltip-id="genericTooltip">&nbsp;</span>
									@Html.Hidden("OwnerID", 0, new { id="hfOwnerID" })
								</div>
							</div>
						</div>
					</div>
					<div class="bookCoverContainer">
						<div id="preloadedCoverPlace" class="coverRef">
							<img id="imgCover" class="bookCover" data-image-src="@Url.Action("GetImage", "Image")" data-default-src="@Url.Content("~/Content/Images/book_cover_not_available.png")" src="@Url.Content("~/Content/Images/book_cover_not_available.png")" alt="Book cover" />
							<input id="hfImageID" name="Image.ID" type="hidden" />
						</div>
						<table>
							<tr>
								<td>ISBN:</td>
								<td>@Html.TextBox("ISBN", "ISBN...", new { id = "txtISBN", @class = "defaultMainFont boxID",data_default="ISBN...", maxLength="10" })</td>
							</tr>
							<tr>
								<td>EAN:</td>
								<td>@Html.TextBox("EAN", "EAN...", new { id = "txtEAN", @class = "defaultMainFont boxID",data_default="EAN..." , maxLength="13" })</td>
							</tr>
						</table>
					</div>
				</div>
			</div>
		<div id="bookValidationSummary">@Html.ValidationSummary()</div>
	}
	</div>